import {Pipe, PipeTransform} from "@angular/core";

/**
 * Created by Administrator on 2017/3/28.
 */
@Pipe({name: 'minuteType'})
export class MinuteTypePipe implements PipeTransform {
    transform(value: any): string {
        let result: string = "-";
        for (let type of this.getTypes()) {
            if (type.value == value) {
                return type.name;
            }
        }
        return "未知"
    }


    getTypes(): any {
        let types: any = [];
        for (let i = 0; i < 59; i++) {
            types.push({
                name: i,
                value: i
            })
        }
        return types
    }
}